import { CodeProps } from "@/types/api"

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 数据连接表单页面标题常量 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export const titleMap: Record<string, string | boolean> = {
    'add': '新建',
    'edit': '编辑',
    'detail': '查看',
}

export const ReadIsolation: CodeProps[] = [
    { label: 'READ_UNCOMMITTED', value: 'READ_UNCOMMITTED' },
    { label: 'READ_COMMITTED', value: 'READ_COMMITTED' },
    { label: 'REPEATABLE_READ', value: 'REPEATABLE_READ' },
    { label: 'SERIALIZABLE', value: 'SERIALIZABLE' }
]

export const Encoding: CodeProps[] = [
    { label: 'UTF-8', value: 'utf8' },
    { label: 'UTF-8 MB4', value: 'utf8mb4' }
]

export const OpenStatus: CodeProps[] = [
    { label: '关闭', value: false },
    { label: '开启', value: true }
]

export const SslMode: CodeProps[] = [
    { label: 'disable', value: 'disable' },
    { label: 'allow', value: 'allow' },
    { label: 'prefer', value: 'prefer' },
    { label: 'require', value: 'require' },
    { label: 'verify-ca', value: 'verify-ca' },
    { label: 'verify-full', value: 'verify-full' }
]

export const LogicalDecodingOutputPlugin: CodeProps[] = [
    { label: 'decoderbufs', value: 'decoderbufs' },
    { label: 'wal2json', value: 'wal2json' },
    { label: 'pgoutput', value: 'pgoutput' }
]




